package com.docker.sys.permission;

import com.jfinal.aop.Aop;
import com.jfinal.plugin.activerecord.Record;

import java.util.List;

public class PermissionThread extends Thread {

    private List<Record> updateList;

    private PermissionDao permissionDao = Aop.get(PermissionDao.class);

    public PermissionThread(List<Record> updateList) {
        this.updateList = updateList;
    }

    public void run() {
        for (Record pmsn : updateList) {
            permissionDao.update(pmsn.getStr("perm_name"), pmsn.getStr("controller"),
                    pmsn.getStr("controller_name"), pmsn.getStr("app_id"),
                    pmsn.getStr("action_key"));
        }
        System.out.println("--------------------******************----------------------");
        System.out.println("--------------------*--权限加载完成--*----------------------");
        System.out.println("--------------------******************----------------------");
    }

}
